{{define "Title"}}不良设置{{end}}
{{define "Content"}}

<script type=text/javascript src="/js/splitPage.js"></script>
<script type=text/javascript src="/js/enterKey.js"></script>
<script type=text/javascript src="/js/setfailure.js"></script>
<script type=text/javascript src="/js/tablestyle.js"></script>

<div class="container-fluid">
<form class="form-horizontal" action="/setfailure" method="POST">
  <fieldset>
    <legend><b>不良设置</b></legend>
    {{if .error}}<div class="alert alert-error"><b>错误: </b>{{.error | html}}</div>
    {{else }}
      {{if .flash}}<div class="alert alert-success"><b>提示: </b>{{.flash | html}}</div>{{end}}
    {{end}}
    <div class="control-group">
      <label class="control-label">不良代码&nbsp;</label>
      <div class="control">
        <input type="text" class="input-large" id="failcode" name="failcode" style="background-color: #FFFFD0;" onkeydown="clicka();" maxlength="30"> <b style="color: red">*</b>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label">不良描述(英文)&nbsp;</label>
      <div class="control">
        <input type="text" class="input-large" id="faildesc" name="faildesc" maxlength="50">
      </div>
    </div>
    <div class="control-group">
      <label class="control-label">不良描述(中文)&nbsp;</label>
      <div class="control">
        <input type="text" class="input-large" id="descchn" name="descchn" maxlength="50">
      </div>
    </div>
    <div class="control-group">
      <label class="control-label">不良类型&nbsp;</label>
      <div class="control">
        <input type="text" class="input-large" id="failtype" name="failtype" onkeydown="clicka();" maxlength="10">
      </div>
    </div>
    <div class="form-actions">
      <button type="submit" class="btn btn-primary">不良设置</button>
    </div>
  </fieldset>
</form>
</div>

{{if .failures}}
  <div class="content-box">
    <div class="content-box-header">
      <p style="font-size: 16px;">&nbsp;&nbsp;<b>不良明细</b></p>
    </div>
    <div class="content-box-content">
    <span id=obj1 style="color: black">
    <table id="tbl_ls" border="1" cellspacing="0" cellpadding="0">
      <thead>
        <tr>
          <th>索引</th>
          <th>不良代码</th>
          <th>不良描述(英文)</th>
          <th>不良描述(中文)</th>
          <th>不良类型</th>
        </tr>  
      </thead>    
      <tbody id="group_one">
        {{range .failures}}
        <tr>
          <td id="detail_idx" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Index | html}}</td>
          <td id="detail_fcd" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Failcode | html}}</td>
          <td id="detail_des" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Faildesc | html}}</td>
          <td id="detail_des" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Descchn | html}}</td>
          <td id="detail_typ" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Failtype | html}}</td>
        </tr>
        {{end}}
      </tbody>
    </table>
    </span>
  </div>
  </div>

  <span id="spanFirst"><img id='first' src="/images/FirstPageImageUrl.gif" onclick="onFirstClick();"/></span> <span id="spanPre"><img id='prev' src="/images/PreviousPageImageUrl.gif" onclick="onPrevClick();"/></span> <span id="spanNext"><img id='next' src="/images/NextPageImageUrl.gif" onclick="onNextClick();"/></span> <span id="spanLast"><img id='last' src="/images/LastPageImageUrl.gif" onclick="onLastClick();"/></span> 当前页: <span id="spanPageNum">{{.curr_page}}</span> / 总页数: <span id="spanTotalPage">{{.total_page}}</span> <span><input id="specialnum" style="width: 60px; color: blue; font-size: 14px; font-weight: bold;" type="text" onkeydown="onSpecialKeydown();"></span><span id="GotoSpecial" style="font-size: 14px; font-weight: bold; cursor:hand; text-decoration:underline; color: #57a000;" onclick="onSpecialClick();">Goto!</span>
<input type=button id="failquery" value="ff" style="display:none">

{{end}}

{{end}}